'''
Created on Dec 6, 2009

@author: Elena
'''
import wx
from PIL import Image
from PIL import ImageDraw

class Geometry():
	'''
	Manipulates geometry from a file.  
	'''


	def __init__(self):
		'''
		Constructor
		'''
		self.image = None
		self.filename = None
		''' TODO:Move this to Shapes '''
		self.shapes = None
		
	def readFromFile(self, filename):
		self.filename = filename
		print('Input file: <%s>.' % filename)
		self.image = Image.open(filename, "r")		
		pass
	
	def readDefaultShape1(self):
		self.filename = None
		print("Initializing geometry to default shape 1.")
		self.points = [(10,10), (10,80), (210,80), (210, 50), (160,50), (160,10)]		
	
	def getPoints(self):
		points = []
		for point in self.points:
			points.append(wx.Point(point[0], point[1]))
		return points			
		
	''' TODO:Move this to Shapes ''' 
	def getShapes(self):
		shapes = []
		for shape in self.shapes:
			shapes.append(shape.dimensions)
		return shapes
	